home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / dev / basic / MethodBBLib.lha / MethodBBLib / Userlibs / MethodBBLib.asc
Encoding:
Text File  |  1997-03-05  |  3.1 KB  |  150 lines

  1. #methodbblib=XX ;put here a free lib number
  2.  
  3. !libheader {#methodbblib,0,0,0,0}
  4.  
  5. !acommand  {#long}
  6. !args      {#long,#long}
  7. !libs
  8. !subs      {_DoMethodA,0,0}
  9. !name      {"DoMethodA","(Obj,Message)"}
  10.  
  11. !acommand  {#long}
  12. !repargs   {1,1,#long,#long}
  13. !libs
  14. !subs      {_DoMethod,0,0}
  15. !name      {"DoMethod","(Obj,MethodID,Tag[,Tag..])"}
  16.  
  17. !acommand  {#long}
  18. !args      {#long,#long,#long}
  19. !libs
  20. !subs      {_DoSuperMethodA,0,0}
  21. !name      {"DoSuperMethodA","(Class,Obj,Message)"}
  22.  
  23. !acommand  {#long}
  24. !repargs   {2,1,#long,#long,#long}
  25. !libs
  26. !subs      {_DoSuperMethod,0,0}
  27. !name      {"DoSuperMethod","(Class,Obj,MethodID,Tag[,Tag..])"}
  28.  
  29. !acommand  {#long}
  30. !args      {#long,#long,#long}
  31. !libs
  32. !subs      {_CoerceMethodA,0,0}
  33. !name      {"CoerceMethodA","(Class,Obj,Message)"}
  34.  
  35. !acommand  {#long}
  36. !repargs   {2,1,#long,#long,#long}
  37. !libs
  38. !subs      {_CoerceMethod,0,0}
  39. !name      {"CoerceMethod","(Class,Obj,MethodID,Tag[,Tag..])"}
  40.  
  41. !acommand  {#long}
  42. !repargs   {2,1,#long,#long,#long}
  43. !libs
  44. !subs      {_SetSuperAttrs,0,0}
  45. !name      {"SetSuperAttrs","(Class,Obj,Tag[,Tag..])"}
  46.  
  47. !libfin
  48.  
  49. ._DoMethodA:
  50.         TST.l   d0
  51.         BEQ.b   cmnullreturn
  52.         MOVE.l  d0,a2
  53.         MOVE.l  d1,a1
  54.         MOVE.l  -4(a2),a0
  55.         BRA     cminvoke
  56.  
  57. ._DoMethod:
  58.         TST.l   d0
  59.         BEQ.b   cmnullreturn
  60.         LEA.l   args(pc),a1
  61.         MOVE.l  a1,d1
  62.         SUBQ    #1,d7
  63. Loop:   MOVE.l  -(a2),(a1)+
  64.         DBF     d7,Loop
  65.         MOVE.l  d0,a2
  66.         MOVE.l  d1,a1
  67.         MOVE.l  -4(a2),a0
  68.         BRA     cminvoke
  69.  
  70. ._DoSuperMethodA:
  71.         MOVE.l  d1,a2
  72.         BEQ.b   cmnullreturn
  73.         MOVE.l  d0,a0
  74.         BEQ.b   cmnullreturn
  75.         MOVE.l  d2,a1
  76.         MOVEA.l $18(a0),a0
  77.         BRA     cminvoke
  78.  
  79. ._DoSuperMethod:
  80.         LEA.l   args(pc),a1
  81.         MOVE.l  a1,d2
  82.         SUBQ    #1,d7
  83. Loop1:  MOVE.l  -(a2),(a1)+
  84.         DBF     d7,Loop1
  85.         MOVE.l  d1,a2
  86.         BEQ.b   cmnullreturn
  87.         MOVE.l  d0,a0
  88.         BEQ.b   cmnullreturn
  89.         MOVE.l  d2,a1
  90.         MOVEA.l $18(a0),a0
  91.         BRA     cminvoke
  92.  
  93. ._CoerceMethodA:
  94.         MOVE.l  d1,a2
  95.         BEQ.b   cmnullreturn
  96.         MOVE.l  d0,a0
  97.         BEQ.b   cmnullreturn
  98.         MOVE.l  d2,a1
  99.         BRA     cminvoke
  100.  
  101. ._CoerceMethod:
  102.         LEA.l   args(pc),a1
  103.         MOVE.l  a1,d2
  104.         SUBQ    #1,d7
  105. Loop2:  MOVE.l  -(a2),(a1)+
  106.         DBF     d7,Loop2
  107.         MOVE.l  d1,a2
  108.         BEQ.b   cmnullreturn
  109.         MOVE.l  d0,a0
  110.         BEQ.b   cmnullreturn
  111.         MOVE.l  d2,a1
  112.         BRA     cminvoke
  113.  
  114. ._SetSuperAttrs:
  115.         LEA.l   args(pc),a1
  116.         MOVE.l  a1,d2
  117.         SUBQ    #1,d7
  118. Loop3:  MOVE.l  -(a2),(a1)+
  119.         DBF     d7,Loop3
  120.         MOVE.l  d1,a2
  121.         BEQ.b   cmnullreturn
  122.         MOVE.l  d0,a0
  123.         BEQ.b   cmnullreturn
  124.         MOVEA.l $18(a0),a0
  125.         MOVE.l  #0,-(a7)
  126.         MOVE.l  d2,-(a7)
  127.         MOVE.l  #$103,-(a7)
  128.         LEA.l   (a7),a1
  129.         PEA.l   ssaret(pc)
  130.         MOVE.l  8(a0),-(a7)
  131.         RTS
  132.  
  133. cminvoke:
  134.         PEA.l   cmreturn(pc)
  135.         MOVE.l  8(a0),-(a7)
  136.         RTS
  137.  
  138. cmnullreturn:
  139.         MOVEQ   #0,d0
  140.  
  141. cmreturn:
  142.         RTS
  143.  
  144. ssaret:
  145.         LEA.l   $c(a7),a7
  146.         MOVEA.l (a7)+,a2
  147.         RTS
  148.  
  149. args:           Dcb.l   20,0
  150.